










#include <stdio.h>
#include <stdlib.h>

int main()
{

    int number;
    int arr[128];
    int i = 0;
    int base;

    printf("Please input a number:");
    scanf("%d",&number);
    printf("plese input base:");
    scanf("%d",&base);

    do
    {
        arr[i] = number%base;
        number = number/base;
        i++;
    }while(number != 0);

    for(i-- ;i >= 0;i--)
    {
        if(arr[i] > 9)
        {printf("%c",arr[i] - 10 + 'A');}
        else
        {printf("%d",arr[i]);}
    }



    return 0;
}


